
function clobg(clor){
SetCookie('clobg', clor);
 var d = document.getElementById("ykyanse");
 if(clor.indexOf("moban")>0){d.style.backgroundImage = "url("+clor+")";}
 else {
    d.style.backgroundImage="";
    d.style.backgroundColor = clor;}
}
function dusu(clor){
SetCookie('dusu', clor);
var sds=getCookie("sudu");
if(sds == null || sds == undefined || sds == ''){sds='4';}
document.getElementById("langdu").href = "javascript:bofang('"+clor+"','"+sds+"');"; 
bofang(clor,sds);
}
function sudu(clor){
SetCookie('sudu', clor);
var sds=getCookie("dusu");
if(sds == null || sds == undefined || sds == ''){sds='2';}
document.getElementById("langdu").href = "javascript:bofang('"+sds+"','"+clor+"');"; 
bofang(sds,clor);
}
function ztdx(ztda){
SetCookie('ztdx', ztda);
 var d = document.getElementById("ykloadshu");
    d.style.fontSize = ztda;	
}
function ztcx(ztcx){
SetCookie('ztcx', ztcx);
 var d = document.getElementById("ykloadshu");
 if(ztcx=='c'){d.style.fontWeight ='bold';	}else{d.style.fontWeight ='';	}
    
}
function ztxz(ztxz){
SetCookie('ztxz', ztxz);
alert('更改字体需要刷新页面才能生效哦！点击确定刷新!');location.reload();
}
function fanye(event){
                //鼠标点击的绝对位置
                Ev= event || window.event;
                var mousePos = mouseCoords(event);
                var x = mousePos.x;
                var y = mousePos.y;
                //alert("鼠标点击的绝对位置坐标："+x+","+y);

                //获取div在body中的绝对位置
                var x1 = $("#ykloadshu").offset().left;
                var y1 = $("#ykloadshu").offset().top;
                //alert("div在body中的绝对位置坐标："+x1+","+y1);

                //鼠标点击位置相对于div的坐标
                var x2 = x - x1;//点击相对宽度
                var y2 = y - y1;
				var ymgd=parseInt($('.content').get(0).offsetHeight);//页面高度
				var dqgd=y2-$('.content').scrollTop();//点击相对高度
				var st = document.getElementById("ykloadshu").offsetWidth;//页面宽度
if(dqgd<ymgd/2){$(function() {
    $('.content').scrollTop($('.content').scrollTop()-ymgd+50);
});}
else{$(function() {
    $('.content').scrollTop($('.content').scrollTop()+ymgd-50);
});}
            }

            //获取鼠标点击区域在Html绝对位置坐标
            function mouseCoords(event){
                if(event.pageX || event.pageY){
                    return {x:event.pageX, y:event.pageY};
                }
                return{
                    x:event.clientX + document.body.scrollLeft - document.body.clientLeft,
                    y:event.clientY + document.body.scrollTop - document.body.clientTop
                };
            }
var clobgs=getCookie("clobg");
var ztdxs=getCookie("ztdx");
var ztcxs=getCookie("ztcx");
var d = document.getElementById("ykloadshu");
 if(ztcxs=='c'){d.style.fontWeight ='bold';	}else{d.style.fontWeight ='';	}
d.style.fontSize = ztdxs;
var sds=getCookie("sudu");var dss=getCookie("dusu");
if(sds == null || sds == undefined || sds == ''){sds='4';}
if(sds == null || sds == undefined || sds == ''){dss='2';}
document.getElementById("langdu").href = "javascript:bofang('"+dss+"','"+sds+"');"; 
document.getElementById("ykyanse").style.backgroundColor = clobgs;
     
